package a2;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class College {
    private List<Building> buildings;
    private List<Course> courses;

    public College() {
        this.buildings = new ArrayList<>();
        this.courses = new ArrayList<>();
    }

    public void addBuilding(Building building) {
        buildings.add(building);
    }

    public void addCourse(Course course) {
        courses.add(course);
    }

    public List<Building> getBuildings() {
        return new ArrayList<>(buildings); // 返回不可修改的列表视图（可选）
    }

    public List<Course> getCourses() {
        return new ArrayList<>(courses); // 返回不可修改的列表视图（可选）
    }

    @Override
    public String toString() {
        return "College{" +
                "buildings=" + buildings +
                ", courses=" + courses +
                '}';
    }
}
